]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
modalDialog: Ensure to let focus manager handle key events
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 1 Feb 2022 13:31:37 +0000 (14:31 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 1 Feb 2022 14:30:24 +0000 (14:30 +0000)
Since the grab no longer lets events bubble up to the stage unstopped,
we should be forwarding the key events that bubbled up to the dialog
to maybe cycle focus.

Fixes focus cycling on keyboard navigation inside dialogs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>

js/ui/modalDialog.js

index 259a9c6bbc5055ba39d9cb7399334e9c5aa14ec3..607000b357f9dcfdb7b75694aa4764cfde31fb33 100644 (file)
@@ -101,6 +101,13 @@ var ModalDialog = GObject.registerClass({
         this.notify('state');
     }
 
+    vfunc_key_press_event() {
+        if (global.focus_manager.navigate_from_event(Clutter.get_current_event()))
+            return Clutter.EVENT_STOP;
+
+        return Clutter.EVENT_PROPAGATE;
+    }
+
     clearButtons() {
         this.dialogLayout.clearButtons();
     }